/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import com.openbrew.openbrewrf.views.POSBeerView;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dchapman
 */
@Entity
@Table(name = "LegacySales")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "LegacySales.findAll", query = "SELECT l FROM LegacySales l"),
    @NamedQuery(name = "LegacySales.findByLsid", query = "SELECT l FROM LegacySales l WHERE l.lsid = :lsid"),
    @NamedQuery(name = "LegacySales.findByNumHalf", query = "SELECT l FROM LegacySales l WHERE l.numHalf = :numHalf"),
    @NamedQuery(name = "LegacySales.findByNumQtr", query = "SELECT l FROM LegacySales l WHERE l.numQtr = :numQtr"),
    @NamedQuery(name = "LegacySales.findByNumSix", query = "SELECT l FROM LegacySales l WHERE l.numSix = :numSix"),
    @NamedQuery(name = "LegacySales.findByNumTT", query = "SELECT l FROM LegacySales l WHERE l.numTT = :numTT")})
public class LegacySales implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "lsid")
    private Integer lsid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NumHalf")
    private int numHalf;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NumQtr")
    private int numQtr;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NumSix")
    private int numSix;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NumTT")
    private int numTT;
    @JoinColumn(name = "beerID", referencedColumnName = "BId")
    @ManyToOne(optional = false)
    private POSBeerView beerID;

    public LegacySales() {
    }

    public LegacySales(Integer lsid) {
        this.lsid = lsid;
    }

    public LegacySales(Integer lsid, int numHalf, int numQtr, int numSix, int numTT) {
        this.lsid = lsid;
        this.numHalf = numHalf;
        this.numQtr = numQtr;
        this.numSix = numSix;
        this.numTT = numTT;
    }

    public Integer getLsid() {
        return lsid;
    }

    public void setLsid(Integer lsid) {
        this.lsid = lsid;
    }

    public int getNumHalf() {
        return numHalf;
    }

    public void setNumHalf(int numHalf) {
        this.numHalf = numHalf;
    }

    public int getNumQtr() {
        return numQtr;
    }

    public void setNumQtr(int numQtr) {
        this.numQtr = numQtr;
    }

    public int getNumSix() {
        return numSix;
    }

    public void setNumSix(int numSix) {
        this.numSix = numSix;
    }

    public int getNumTT() {
        return numTT;
    }

    public void setNumTT(int numTT) {
        this.numTT = numTT;
    }

    public POSBeerView getBeerID() {
        return beerID;
    }

    public void setBeerID(POSBeerView beerID) {
        this.beerID = beerID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (lsid != null ? lsid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LegacySales)) {
            return false;
        }
        LegacySales other = (LegacySales) object;
        if ((this.lsid == null && other.lsid != null) || (this.lsid != null && !this.lsid.equals(other.lsid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.LegacySales[ lsid=" + lsid + " ]";
    }
    
}
